import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int cnt=0;
        while(cnt<n-1){
            int a=sc.nextInt();
            int b=sc.nextInt();
            cnt++;
        }
        System.out.println("0");
    }
    public static void main5(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String str=sc.next();
        int cnt=0;
        for(int i=0;i<n;i++){
            if(isRight(str,i+1)){
                cnt++;
            }
        }
        double res=cnt*1.0/n;
        System.out.println(res);
    }
    public static boolean isRight(String str,int num){
        char[] ch=str.toCharArray();
        for(int i=num;i<ch.length-1;i++){
            if(ch[i]==ch[i+1]){
                return true;
            }
        }
        return false;
    }
    public static void main3(String[] args) {
        Scanner sc=new Scanner(System.in);
        int T=sc.nextInt();
        int cnt=0;
        while(cnt<T){
            String str=sc.next();
            int count=0;
            char[] ch=str.toCharArray();
            int count0=0;
            int count1=0;
            if(ch[0]=='0'){
                count0++;
            }else{
                count1++;
            }
            for(int i=1;i<ch.length;i++){
                if(ch[i]!=ch[i-1]){
                    if(ch[i]=='1'){
                        count1++;
                    }else{
                        count0++;
                    }
                }
            }
            if(count1+count0<6){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
            cnt++;
        }
    }
    public static void main2(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] arr=new int[n+1];
        int x=0;
        int cnt=1;
        PriorityQueue<Integer> heap=new PriorityQueue<>();
        for(int i=1;i<n+1;i++){
            arr[i]=sc.nextInt();
            heap.add(arr[i]);
        }
        while(!heap.isEmpty()){
            if(cnt%2==1){
                x+=heap.poll();
            }else{
                x-=heap.poll();
            }
            cnt++;
        }
        System.out.println(x);
    }
    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        if(n%2==1){
            System.out.println("kou");
        }else{
            System.out.println("yukari");
        }
    }
}